﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Itop.YHPC.Model;
using Itop.YHPC.controller;

namespace Itop.YHPC.workflow
{
    public partial class workflow_change_ajax : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id = Request.QueryString["id"];
            string zy = Request.QueryString["zy"];
            string gsbm = Request.QueryString["gsbm"];
            string txt = Request.QueryString["txt"];
            yhpcMain main = workflowController.GetMain(id);
            main.yhzyfl = zy;
            main.gsbm = gsbm;
            main.lcstatus = "已完成二级单位领导审核";
            main.lcflag = "105";
            main.lcrecord += "->" + string.Format("{0}于{1}[{2}]-修改归属部门，原因："+txt, (Session["user"] as sysuser).UserName, DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss"), GetLCName(main.bhflag));
            workflowController.Update(main);
        }

        public string GetLCName(string lcflag)
        {
            sysprog prog = workflowController.GetProgList(" where id='" + lcflag + "'")[0];
            return prog.ProgName;
        }
    }
}
